package grisar.gris.tower;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Point;
import grisar.gris.struct.I_Bounding;
import grisar.gris.struct.I_Tower;
import grisar.gris.struct.bound.BoundCircle;

public class SampleTower implements I_Tower{

	private Point pos;
	private Paint paint = new Paint();
	private I_Bounding bound;
	private Point drawOffset;
	private Bitmap bitmap;
	
	public SampleTower(Point pos, Bitmap bitmap){
		
		//Bitmap mBackground = BitmapFactory.decodeResource(drawable.image);
		
		this.pos=pos;
		paint.setColor(Color.CYAN);
		this.bitmap = bitmap;
		drawOffset = new Point(-bitmap.getWidth()/2,-bitmap.getHeight()+20);
		//TODO MAke radius dynamix
		bound = new BoundCircle(this, 30);
		
	}
	
	//@Override
	public void draw(Canvas canvas) {
	
		//bound.draw(canvas);
		canvas.drawBitmap(bitmap, pos.x+drawOffset.x, pos.y+drawOffset.y, paint);
	}

	//@Override
	public Point getPosition() {

		return pos;
	}

	//@Override
	public void setPosition(Point pos) {
		
		this.pos=pos;
	}

	//@Override
	public int getPrice() {
		// TODO Auto-generated method stub
		return 0;
	}

	//@Override
	public int sell() {
		// TODO Auto-generated method stub
		return 0;
	}

	//@Override
	public int uppgradePrice() {
		// TODO Auto-generated method stub
		return 0;
	}

	//@Override
	public int uppgradeTower() {
		// TODO Auto-generated method stub
		return 0;
	}

	//@Override
	public boolean isColliding(I_Bounding bound) {

		return this.bound.isColliding(bound.getBounding());
	}

	//@Override
	public I_Bounding getBounding() {
		
		return bound;
	}

	
}
